<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html" xmlns:constants="http://www.tuanzi.com/constants/tags">

    <div class="ui-g" id="rechargeRecordDataTable">
        <div class="ui-g-12">
            <h3>
                <b>基础信息</b>
            </h3>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="uvValue" value="UV价值"/>
            <strong style="color: red">*</strong>
        </div>
        <div class="ui-g-4">
            <p:inputNumber id="uvValue" value="#{loanProductInfoBean.$.uvValue}"
                         disabled="#{loanProductInfoBean.isView()}">
            </p:inputNumber>
        </div>

        <h:panelGroup rendered="#{loanProductInfoBean.isEdit() or loanProductInfoBean.isView()}">
        <div class="ui-g-12">
            <h3 style="padding-bottom: 10px"><b>充值信息</b><p:commandButton value="充值" style="width: 90px;float: right"
                                            actionListener="#{loanProductInfoBean.onAddRecharge}"

                                            oncomplete="PF('recharge-model').show()" disabled="#{loanProductInfoBean.isView()}"/></h3>
            <div class="ui-g-12">
                <p:dataTable id="dataTable"
                             style="width: 100%;text-align:center"
                             rowIndexVar="rowIndex" var="record"
                             rows="#{constants:get('ROWS')}"
                             lazy="true"
                             paginator="true"
                             paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                             rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                             emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                             reflow="true"
                             resizableColumns="true"
                             value="#{loanProductInfoBean.rechargeRecordList}">
                    <p:column headerText="充值时间" style="text-align:center;">
                        <h:outputText value="#{record.create_time} ">
                        </h:outputText>
                    </p:column>
                    <p:column headerText="充值金额" style="text-align:center;">
                        <h:outputText value="#{record.amount}" />
                    </p:column>
                    <p:column headerText="操作人" style="text-align:center;">
                        <h:outputText value="#{record.creator}"/>
                    </p:column>
                    <p:column headerText="备注" style="text-align:center;">
                        <h:outputText value="#{record.remark}"/>
                    </p:column>
                </p:dataTable>
            </div>
        </div>

        <div class="ui-g-12">
            <h3 style="margin-bottom: 10px"><b>消费信息</b><small> 当前余额(<h:outputLabel value="#{loanProductInfoBean.balance}"></h:outputLabel>)</small></h3>
            <div class="ui-g-12">
                <p:dataTable id="consumeDataTable"
                             style="width: 100%"
                             var="model"
                             value="#{loanProductInfoBean.loanProductConsumeRecords}"
                             rows="#{constants:get('ROWS')}"
                             lazy="true"
                             paginator="true"
                             paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                             rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                             emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                             reflow="true"
                             resizableColumns="true">

                    <p:column headerText="时间" style="text-align:center">
                        <h:outputText value="#{model.create_date}">
                            <f:convertDateTime pattern="yyyy-MM-dd" />
                        </h:outputText>
                    </p:column>
                    <p:column headerText="UV数" style="text-align:center">
                        <h:outputText value="#{model.uv_num}"/>
                    </p:column>
                    <p:column headerText="UV价值" style="text-align:center;">
                        <h:outputText value="#{model.uv_value}"/>
                    </p:column>
                    <p:column headerText="消费金额" style="text-align:center;">
                        <h:outputText value="#{model.consume_money}"/>
                    </p:column>
                </p:dataTable>
            </div>
        </div>
        </h:panelGroup>
    </div>
</ui:composition>